package cn.isjinhao.crws.sql.grammar.retrieve.represention.table;

import cn.isjinhao.crws.sql.grammar.Binary;
import cn.isjinhao.crws.sql.grammar.CurdStatement;
import cn.isjinhao.crws.sql.grammar.CurdStatementVisitor;
import cn.isjinhao.crws.sql.lexical.token.Token;

/**
 * @author 01395265
 * @date 2021/3/3
 */
public class TableSeg extends Binary {

    private CurdStatement condition;

    public TableSeg(CurdStatement leftCurdStatement, Token token,
                    CurdStatement rightCurdStatement, CurdStatement condition) {
        super(leftCurdStatement, token, rightCurdStatement);
        this.condition = condition;
    }

    public TableSeg(CurdStatement leftCurdStatement, Token token,
                    CurdStatement rightCurdStatement) {
        super(leftCurdStatement, token, rightCurdStatement);
    }

    @Override
    public <R> R accept(CurdStatementVisitor<R> curdStatementVisitor) {
        return curdStatementVisitor.visitTableSeg(this);
    }

    public CurdStatement getCondition() {
        return condition;
    }
}
